<div id="notices">
	<%= render :partial => "group_errors" %>
</div>

<span style="float:right;">
<% form_tag :action => 'set_new_scope' do %>
	<label>
		<b>Groups Filter: </b> <%= select :group, :scope, Group::SCOPE_CHOICES  %>
	</label>
	<%= submit_tag "Set Filter" %>
<% end %>
</span>

<% form_remote_tag :url => {:action => 'new_root'} do %>

<%= link_to_function "New Root",
    visual_effect(:toggle_appear, :new_group_form) %>
<span id="new_group_form" style="display:none;"> <%= text_field :group, :name %>
<%= submit_tag 'Create' %></span>
<% end %>

<div style="height:20px">
	<span id='progress' style='display:none;'><img src='/images/working.gif'></span>
</div>
<%= link_to_remote 'expand all', :url => {:action => 'expand_all'} %> | <%= link_to_remote 'collapse all', :url => {:action => 'collapse_all'} %>
<% unless session[:sticky_group].nil? or session[:sticky_group].root? %>
 | <%= link_to_remote "toggle: #{session[:sticky_group].name}", :url => {:action => 'toggle_sticky_group', :sticky_group_id => session[:sticky_group]} rescue nil %>
<% end %>

<div>
	<h3>Now Showing <%= current_user.readable_scope %> Groups</h3>
</div>

<div id="all-groups">
	<%= render :partial => "all_groups" %>
</div>